# Allow customization of the process title
# setproctitle >= 1.1 works with Python 3
#

pkgname=setproctitle
pkgver=1.1.2
pkgrel=1
pkgdesc="Allow customization of the process title"
url="http://code.google.com/p/py-setproctitle/"
license=('BSD')
arch=('any')
depends=('python2')			# or 'python'
source=("http://pypi.python.org/packages/source/s/${pkgname}/${pkgname}-${pkgver}.tar.gz")
md5sums=('d90d8e396f372e69ea85c98cec7a1027')

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"

	# Patch (Python < 3.0)
	for file in `find . -type f -name '*.py'`; do
		sed -i 's|env python|env python2.7|' ${file}
	done

	/usr/bin/python2.7 setup.py build
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"

	/usr/bin/python2.7 setup.py install --root=${pkgdir}

	install -D -m644 COPYRIGHT ${pkgdir}/usr/share/licenses/${pkgname}/COPYRIGHT
}
